package com.wangzhen.codebase;

class SafeCalc {
    long value = 0L;

    long get() {
        synchronized (new Object()) {
            return value;
        }
    }

    void addOne() {
        synchronized (this){
            value += 1;
        }
    }
}